from coin.exchange.binance.kr_rest.product import BinanceProduct
from coin.exchange.bitfinex_v2.kr_rest.product import BitfinexProduct
from coin.exchange.bitflyer_v1.kr_rest.futures_product import (BitflyerFuturesProduct)
from coin.exchange.bitmex.kr_rest.futures_product import BitmexFuturesProduct
from coin.exchange.gdax.kr_rest.product import GdaxProduct
from coin.exchange.okex.kr_rest.product import OkexProduct
from coin.exchange.okex_futures.kr_rest.futures_product import (OkexFuturesProduct)


def get_products_dict():
  return dict(
      okex_futures_product1=OkexFuturesProduct.FromStr("BTC-USD.THIS_WEEK"),
      okex_futures_product2=OkexFuturesProduct.FromStr("BTC-USD.NEXT_WEEK"),
      okex_futures_product3=OkexFuturesProduct.FromStr("BTC-USD.QUARTER"),
      bitmex_product=BitmexFuturesProduct.FromStr('BTC-USD.PERPETUAL'),
      bitflyer_product=BitflyerFuturesProduct.FromStr("BTC-JPY.PERPETUAL"),
      binance_product=BinanceProduct.FromStr("BTC-USDT"),
      bitfinex_product=BitfinexProduct.FromStr("BTC-USDT"),
      okex_product=OkexProduct.FromStr("BTC-USDT"),
      gdax_product=GdaxProduct.FromStr("BTC-USD"),
      eth_okex_futures_product2=OkexFuturesProduct.FromStr("ETH-USD.QUARTER"),
      eth_okex_futures_product3=OkexFuturesProduct.FromStr("ETH-USD.THIS_WEEK"),
      eos_okex_futures_product3=OkexFuturesProduct.FromStr("EOS-USD.QUARTER"),
      bch_okex_futures_product3=OkexFuturesProduct.FromStr("BCH-USD.QUARTER"),
  )


def get_products(additional_products=None):
  prod_dict = get_products_dict()
  products = [
      prod_dict['bitmex_product'],
      prod_dict['okex_futures_product1'],
      prod_dict['okex_futures_product2'],
      prod_dict['okex_futures_product3']
  ]
  if additional_products is not None:
    for prod in additional_products:
      products.append(prod_dict[prod])
  return products
